package com.stanley.alogrithm.special;

public class FindSingleNumber {
    public static void main(String[] args) {
        int[] data = {1, 0, 1, 0, 8,3,9,9, 8};

        int result = findSingleNumber(data);
        System.out.print("result: " + result);

    }

    public static int findSingleNumber(int[] data) {

        int sum = 0;
        for (int i = 0; i < data.length; i++) {
            sum = sum ^ data[i];
        }
        return sum;
    }
}
